from pathlib import Path

from autogen.coding import CodeBlock, LocalCommandLineCodeExecutor
import json
work_dir = Path("coding")
work_dir.mkdir(exist_ok=True)

executor = LocalCommandLineCodeExecutor(work_dir=work_dir)
code ="""
print("Hello world")
print("88")
"""

res =    executor.execute_code_blocks(
        code_blocks=[
            CodeBlock(language="python", code=code),
        ]
    )
print(res.output)
